package com.czeczek.bossa;

import java.util.List;

import org.springframework.batch.item.file.transform.DelimitedLineTokenizer;

public class BossaEODtokenizer extends DelimitedLineTokenizer {

	private static final String ZERO_VALUE = "0";
	
	@Override
	protected List<String> doTokenize(String line) {
		List<String> tokens = super.doTokenize(line);
		
		//If last token is missing from the input file, put zero value
		if (names.length - 1 == tokens.size()) {
			tokens.add(ZERO_VALUE);
		}
		
		return tokens;
	}

}
